//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.salesperson;

import java.io.Serializable;
import java.math.BigDecimal;

public class SalesPerson
        implements Serializable {

    public SalesPerson() {
    }

    public SalesPerson(Integer id, String prenom, String secteur, String resultatDate, BigDecimal objectif, String objectifDate, String telephone,
            String portable, String fax, BigDecimal tauxVente, BigDecimal tauxTotalVente, String commentaire, String email, String niveau,
            BigDecimal resultat, String nom, String updateLastTime, String userId, String addrLn1, String addrLn2, String zip,
            String city, String country, String salesPersonFamily) {
        setId(id);
        setPrenom(prenom);
        setSecteur(secteur);
        setResultatDate(resultatDate);
        setObjectif(objectif);
        setObjectifDate(objectifDate);
        setTelephone(telephone);
        setPortable(portable);
        setFax(fax);
        setTauxVente(tauxVente);
        setTauxTotalVente(tauxTotalVente);
        setCommentaire(commentaire);
        setEmail(email);
        setNiveau(niveau);
        setResultat(resultat);
        setNom(nom);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
        setSalesPersonFamily(salesPersonFamily);
        setAddrLn1(addrLn1);
        setAddrLn2(addrLn2);
        setZip(zip);
        setCity(city);
        setCountry(country);
    }

    public SalesPerson(SalesPerson salesPerson) {
        setId(salesPerson.getId());
        setPrenom(salesPerson.getPrenom());
        setSecteur(salesPerson.getSecteur());
        setResultatDate(salesPerson.getResultatDate());
        setObjectif(salesPerson.getObjectif());
        setObjectifDate(salesPerson.getObjectifDate());
        setTelephone(salesPerson.getTelephone());
        setPortable(salesPerson.getPortable());
        setFax(salesPerson.getFax());
        setTauxVente(salesPerson.getTauxVente());
        setTauxTotalVente(salesPerson.getTauxTotalVente());
        setCommentaire(salesPerson.getCommentaire());
        setEmail(salesPerson.getEmail());
        setNiveau(salesPerson.getNiveau());
        setResultat(salesPerson.getResultat());
        setNom(salesPerson.getNom());
        setUpdateLastTime(salesPerson.getUpdateLastTime());
        setUserId(salesPerson.getUserId());
        setSalesPersonFamily(salesPerson.getSalesPersonFamily());
        setAddrLn1(salesPerson.getAddrLn1());
        setAddrLn2(salesPerson.getAddrLn2());
        setZip(salesPerson.getZip());
        setCity(salesPerson.getCity());
        setCountry(salesPerson.getCountry());
    }

    public Integer getId() {
        return id;
    }

    public String getPrenom() {
        return prenom;
    }

    public String getSecteur() {
        return secteur;
    }

    public String getTelephone() {
        return telephone;
    }

    public String getPortable() {
        return portable;
    }

    public String getFax() {
        return fax;
    }

    public BigDecimal getTauxVente() {
        return tauxVente;
    }

    public BigDecimal getTauxTotalVente() {
        return tauxTotalVente;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public String getEmail() {
        return email;
    }

    public String getNiveau() {
        return niveau;
    }

    public String getNom() {
        return nom;
    }

    public BigDecimal getResultat() {
        return resultat;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public void setSecteur(String civilite) {
        secteur = civilite;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public void setPortable(String portable) {
        this.portable = portable;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public void setTauxVente(BigDecimal tauxVente) {
        this.tauxVente = tauxVente;
    }

    public void setTauxTotalVente(BigDecimal tauxTotalVente) {
        this.tauxTotalVente = tauxTotalVente;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setNiveau(String niveau) {
        this.niveau = niveau;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public void setResultat(BigDecimal resultat) {
        this.resultat = resultat;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getObjectifDate() {
        return objectifDate;
    }

    public BigDecimal getObjectif() {
        return objectif;
    }

    public String getResultatDate() {
        return resultatDate;
    }

    public void setObjectifDate(String objectifDate) {
        this.objectifDate = objectifDate;
    }

    public void setObjectif(BigDecimal objectif) {
        this.objectif = objectif;
    }

    public void setResultatDate(String resultatDate) {
        this.resultatDate = resultatDate;
    }

    public String getSalesPersonFamily() {
        return salesPersonFamily;
    }

    public void setSalesPersonFamily(String salesPersonFamily) {
        this.salesPersonFamily = salesPersonFamily;
    }

    public String getAddrLn1() {
        return addrLn1;
    }

    public void setAddrLn1(String addrLn1) {
        this.addrLn1 = addrLn1;
    }

    public String getAddrLn2() {
        return addrLn2;
    }

    public void setAddrLn2(String addrLn2) {
        this.addrLn2 = addrLn2;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "prenom=" + getPrenom() + " " + "secteur=" + getSecteur() + " " + "resultatDate=" + getResultatDate() + " " + "objectif=" + getObjectif() + " " + "objectifDate=" + getObjectifDate() + " " + "telephone=" + getTelephone() + " " + "portable=" + getPortable() + " " + "fax=" + getFax() + " " + "tauxVente=" + getTauxVente() + " " + "tauxTotalVente=" + getTauxTotalVente() + " " + "commentaire=" + getCommentaire() + " " + "email=" + getEmail() + " " + "niveau=" + getNiveau() + " " + "resultat=" + getResultat() + " " + "nom=" + getNom() + " " + "addrLn1=" + getAddrLn1() + " " + "addrLn2=" + getAddrLn2() + " " + "zip=" + getZip() + " " + "city=" + getCity() + " " + "country=" + getCountry() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "salesPersonFamily=" + getSalesPersonFamily() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof SalesPerson) {
            SalesPerson lTest = (SalesPerson) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (prenom == null) {
                lEquals = lEquals && lTest.prenom == null;
            } else {
                lEquals = lEquals && prenom.equals(lTest.prenom);
            }
            if (secteur == null) {
                lEquals = lEquals && lTest.secteur == null;
            } else {
                lEquals = lEquals && secteur.equals(lTest.secteur);
            }
            if (resultatDate == null) {
                lEquals = lEquals && lTest.resultatDate == null;
            } else {
                lEquals = lEquals && resultatDate.equals(lTest.resultatDate);
            }
            if (telephone == null) {
                lEquals = lEquals && lTest.telephone == null;
            } else {
                lEquals = lEquals && telephone.equals(lTest.telephone);
            }
            if (portable == null) {
                lEquals = lEquals && lTest.portable == null;
            } else {
                lEquals = lEquals && portable.equals(lTest.portable);
            }
            if (fax == null) {
                lEquals = lEquals && lTest.fax == null;
            } else {
                lEquals = lEquals && fax.equals(lTest.fax);
            }
            if (tauxVente == null) {
                lEquals = lEquals && lTest.tauxVente == null;
            } else {
                lEquals = lEquals && tauxVente.equals(lTest.tauxVente);
            }
            if (tauxTotalVente == null) {
                lEquals = lEquals && lTest.tauxTotalVente == null;
            } else {
                lEquals = lEquals && tauxTotalVente.equals(lTest.tauxTotalVente);
            }
            if (commentaire == null) {
                lEquals = lEquals && lTest.commentaire == null;
            } else {
                lEquals = lEquals && commentaire.equals(lTest.commentaire);
            }
            if (email == null) {
                lEquals = lEquals && lTest.email == null;
            } else {
                lEquals = lEquals && email.equals(lTest.email);
            }
            if (niveau == null) {
                lEquals = lEquals && lTest.niveau == null;
            } else {
                lEquals = lEquals && niveau.equals(lTest.niveau);
            }
            if (resultat == null) {
                lEquals = lEquals && lTest.resultat == null;
            } else {
                lEquals = lEquals && resultat.equals(lTest.resultat);
            }
            if (nom == null) {
                lEquals = lEquals && lTest.nom == null;
            } else {
                lEquals = lEquals && nom.equals(lTest.nom);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (objectif == null) {
                lEquals = lEquals && lTest.objectif == null;
            } else {
                lEquals = lEquals && objectif.equals(lTest.objectif);
            }
            if (objectifDate == null) {
                lEquals = lEquals && lTest.objectifDate == null;
            } else {
                lEquals = lEquals && objectifDate.equals(lTest.objectifDate);
            }
            if (salesPersonFamily == null) {
                lEquals = lEquals && lTest.salesPersonFamily == null;
            } else {
                lEquals = lEquals && salesPersonFamily.equals(lTest.salesPersonFamily);
            }
            if (addrLn1 == null) {
                lEquals = lEquals && lTest.addrLn1 == null;
            } else {
                lEquals = lEquals && addrLn1.equals(lTest.addrLn1);
            }
            if (addrLn2 == null) {
                lEquals = lEquals && lTest.addrLn2 == null;
            } else {
                lEquals = lEquals && addrLn2.equals(lTest.addrLn2);
            }
            if (zip == null) {
                lEquals = lEquals && lTest.zip == null;
            } else {
                lEquals = lEquals && zip.equals(lTest.zip);
            }
            if (city == null) {
                lEquals = lEquals && lTest.city == null;
            } else {
                lEquals = lEquals && city.equals(lTest.city);
            }
            if (country == null) {
                lEquals = lEquals && lTest.country == null;
            } else {
                lEquals = lEquals && country.equals(lTest.country);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (prenom == null ? 0 : prenom.hashCode());
        result = 37 * result + (secteur == null ? 0 : secteur.hashCode());
        result = 37 * result + (resultatDate == null ? 0 : resultatDate.hashCode());
        result = 37 * result + (telephone == null ? 0 : telephone.hashCode());
        result = 37 * result + (portable == null ? 0 : portable.hashCode());
        result = 37 * result + (fax == null ? 0 : fax.hashCode());
        result = 37 * result + (tauxVente == null ? 0 : tauxVente.hashCode());
        result = 37 * result + (tauxTotalVente == null ? 0 : tauxTotalVente.hashCode());
        result = 37 * result + (commentaire == null ? 0 : commentaire.hashCode());
        result = 37 * result + (email == null ? 0 : email.hashCode());
        result = 37 * result + (niveau == null ? 0 : niveau.hashCode());
        result = 37 * result + (resultat == null ? 0 : resultat.hashCode());
        result = 37 * result + (nom == null ? 0 : nom.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (objectif == null ? 0 : objectif.hashCode());
        result = 37 * result + (objectifDate == null ? 0 : objectifDate.hashCode());
        result = 37 * result + (salesPersonFamily == null ? 0 : salesPersonFamily.hashCode());
        result = 37 * result + (addrLn1 == null ? 0 : addrLn1.hashCode());
        result = 37 * result + (addrLn2 == null ? 0 : addrLn2.hashCode());
        result = 37 * result + (zip == null ? 0 : zip.hashCode());
        result = 37 * result + (city == null ? 0 : city.hashCode());
        result = 37 * result + (country == null ? 0 : country.hashCode());
        return result;
    }
    private Integer id;
    private String nom;
    private String prenom;
    private String secteur;
    private String telephone;
    private String portable;
    private String fax;
    private String email;
    private String niveau;
    private BigDecimal tauxVente;
    private BigDecimal tauxTotalVente;
    private BigDecimal resultat;
    private String resultatDate;
    private BigDecimal objectif;
    private String objectifDate;
    private String commentaire;
    private String updateLastTime;
    private String userId;
    private String salesPersonFamily;
    private String addrLn1;
    private String addrLn2;
    private String zip;
    private String city;
    private String country;
}
